package com.biz.primus.ms.oms.api;

import com.biz.primus.ms.base.api.BaseApiController;
import com.biz.primus.ms.oms.service.delivery.DeliveryMonitoringService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * oms系统定时任务api
 * @author yanweijin
 * @date 2017/11/25
 */
@RestController
@RequestMapping("soa/omsTaskApi")
@Api("oms系统定时任务api")
public class OmsTaskApiController extends BaseApiController {

	@Autowired
	private DeliveryMonitoringService deliveryMonitoringService;

	@ApiOperation("扫描超时的闪送订单,将其记录以待处理")
	@PostMapping("scanTimeoutOrder")
	public void scanTimeoutOrder(@ApiParam("是否通过查询数据来获取超时订单") @RequestParam(name = "useJpaQuery", defaultValue = "false")boolean useJpaQuery){
		deliveryMonitoringService.scanMonitoredSource(useJpaQuery);
	}


}
